/**
 * menu api
 */
import $http from '../../http/http'

/**
 * 分页获取菜单列表
 */
export const queryMenusPage = (menuAlias, menuType, menuLevel, pageNo, pageSize) => {
    return $http.get("menuOperations/queryMenusPage", {
        params: {
            alias: menuAlias,
            type: menuType,
            level: menuLevel,
            pageNo: pageNo,
            pageSize: pageSize
        }
    });
}

/**
 * 获取菜单列表
 */
export const queryMenus = () => {
    return $http.get("menuOperations/queryMenus", {
        params: {
        }
    });
}

/**
 * 获取一级菜单列表
 */
export const queryFirstMenus = () => {
    return $http.get("menuOperations/queryFirstMenus", {
        params: {
        }
    });
}

/**
 * 获取父菜单列表
 */
export const queryMenusByLevel = (menuLevel) => {
    return $http.get("menuOperations/queryParentMenusByLevel", {
        params: {
            level: menuLevel
        }
    });
}

/**
 * 新增菜单
 */
export const newMenu = (data) => {
    return $http.post("menuOperations/newMenu", data);
}

/**
 * 删除菜单
 */
export const deleteMenu = (data) => {
    return $http.post("menuOperations/deleteMenu", data);
}